/// <reference path="./../custom-typings/index.d.ts" />

import 'antd/dist/antd.less';
import './asset/style/main.scss';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { createStore, applyMiddleware, compose } from 'redux';
import { Provider } from 'react-redux';
import thunkMiddleware from 'redux-thunk';
import reducer from './reducer/reducer';
import App from './component/app/App';

const composeEnhancers = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const preloadedState = {};
const middleware = [thunkMiddleware];

const store = createStore<any>(
    reducer,
    preloadedState,
    composeEnhancers(applyMiddleware(...middleware))
);

window.onload = function () {
    ReactDOM.render(
        <Provider store={store}>
            <App />
        </Provider>,
        document.getElementById('app-placeholder')
    );
};
